{% extends 'email_base.html' %}

{% load i18n seahub_tags %}

{% block email_con %}

<p style="font-size:14px; line-height: 1.5; color:#121214; margin:.2em 0 12px;">{% blocktrans with name=user_name %}Hi, {{ name }}{% endblocktrans %}</p>
<p style="font-size:14px; line-height: 1.5; color:#434144; margin:.2em 0;">
{% blocktrans count num=notice_count %}
You've got 1 new notice on {{ site_name }}:
{% plural %}
You've got {{num}} new notices on {{ site_name }}:
{% endblocktrans %}
</p>

    <table style="width:100%; margin:12px 0 20px; table-layout:fixed; border-spacing: 0; border-collapse: collapse;">
        <tr>
            <th width="9%" style="padding: 5px 3px; border-bottom: 1px solid #eee;"></th>
            <th width="69%" style="padding: 5px 3px; border-bottom: 1px solid #eee; font-size:13px; text-align: left; font-weight: normal; color: #9c9c9c;">{% trans "Message" %}</th>
            <th width="22%" style="padding: 5px 3px; border-bottom: 1px solid #eee; font-size:13px; text-align: left; font-weight: normal; color: #9c9c9c;">{% trans "Time" %}</th>
        </tr>
        {% for notice in notices %}
        <tr>
            <td style="padding:8px 3px 5px; border-bottom: 1px solid #eee; text-align:center; vertical-align:top;"><img src="{{notice.avatar_src}}" width="32" height="32" alt="" style="border-radius:1000px;" /></td>
            <td style="padding: 5px 3px; border-bottom: 1px solid #eee; font-size: 13px; color: #333; word-wrap: break-word;">
                {% if notice.is_repo_share_msg %}
                    <p style="line-height:1.5; margin:.2em 10px .2em 0;">
                        {% if notice.shared_type == 'library' %}
                        {% include "notifications/notice_msg/repo_share_msg.html" with user=notice.notice_from lib_url=notice.repo_url lib_name=notice.repo_name %}
                        {% else %}
                        {% include "notifications/notice_msg/folder_share_msg.html" with user=notice.notice_from lib_url=notice.repo_url lib_name=notice.repo_name %}
                        {% endif %}
                    </p>

                {% elif notice.is_repo_share_to_group_msg %}
                    <p style="line-height:1.5; margin:.2em 10px .2em 0;">
                        {% if notice.shared_type == 'library' %}
                        {% include "notifications/notice_msg/repo_share_to_group_msg.html" with user=notice.notice_from lib_url=notice.repo_url lib_name=notice.repo_name group_url=notice.group_url group_name=notice.group_name %}
                        {% else %}
                        {% include "notifications/notice_msg/folder_share_to_group_msg.html" with user=notice.notice_from lib_url=notice.repo_url lib_name=notice.repo_name group_url=notice.group_url group_name=notice.group_name %}
                        {% endif %}
                    </p>

                {% elif notice.is_user_message %}
                    <p style="line-height:1.5; margin:.2em 10px .2em 0;">{% blocktrans with msg_url=notice.user_msg_url user=notice.notice_from %}You have received a <a href="{{ url_base }}{{msg_url}}">new message</a> from {{user}}.{% endblocktrans %}</p>
                    {% if notice.user_msg %}
                    <p style="line-height:1.5; margin:.2em 10px .2em 0;">{{notice.user_msg}}</p>
                    {% endif %}

                {% elif notice.is_file_uploaded_msg %}
                    <p style="line-height:1.5; margin:.2em 10px .2em 0;">{% blocktrans with file_url=notice.file_link file_name=notice.file_name folder_url=notice.folder_link folder_name=notice.folder_name %}A file named <a href="{{url_base}}{{file_url}}">{{file_name}}</a> is uploaded to your folder <a href="{{url_base}}{{folder_url}}">{{folder_name}}</a>.{% endblocktrans %}</p>

                {% elif notice.is_folder_uploaded_msg %}
                    <p style="line-height:1.5; margin:.2em 10px .2em 0;">{% blocktrans with folder_url=notice.folder_link folder_name=notice.folder_name parent_dir_url=notice.parent_dir_link parent_dir_name=notice.parent_dir_name %}A folder named <a href="{{url_base}}{{folder_url}}">{{folder_name}}</a> is uploaded to your folder <a href="{{url_base}}{{parent_dir_url}}">{{parent_dir_name}}</a>.{% endblocktrans %}</p>

                {% elif notice.is_group_join_request %}
                <p style="line-height:1.5; margin:.2em 10px .2em 0;">{% blocktrans with user_url=notice.grpjoin_user_profile_url user=notice.notice_from grp_url=notice.grpjoin_group_url grp_name=notice.grpjoin_group_name msg=notice.grpjoin_request_msg %}User <a href="{{url_base}}{{user_url}}">{{user}}</a> has asked to join group <a href="{{url_base}}{{grp_url}}">{{grp_name}}</a>, verification message: {{msg}}{% endblocktrans %}</p>

                {% elif notice.is_add_user_to_group %}
                <p style="line-height:1.5; margin:.2em 10px .2em 0;">{% blocktrans with user_url=notice.group_staff_profile_url user=notice.notice_from grp_url=notice.group_url grp_name=notice.group_name %}User <a href="{{url_base}}{{user_url}}">{{user}}</a> has added you to group <a href="{{url_base}}{{grp_url}}">{{grp_name}}</a>{% endblocktrans %}</p>

                {% elif notice.is_file_comment_msg %}
                <p style="line-height:1.5; margin:.2em 10px .2em 0;">{% blocktrans with file_url=notice.file_url file_name=notice.file_name author=notice.author %}File <a href="{{url_base}}{{file_url}}">{{file_name}}</a> has a new comment from user {{author}}{% endblocktrans %}</p>

                {% elif notice.is_guest_invitation_accepted_msg %}
                <p style="line-height:1.5; margin:.2em 10px .2em 0;">{% blocktrans with user=notice.inv_accepter inv_url=notice.inv_url time=notice.inv_accept_at %}Guest {{user}} accepted your <a href="{{url_base}}{{inv_url}}">invitation</a> at {{time}}.{% endblocktrans %}</p>

                {% elif notice.is_deleted_files_msg %}
                <p style="line-height:1.5; margin:.2em 10px .2em 0;">{% blocktrans with repo_url=notice.repo_url repo_name=notice.repo_name %}A large number of files in your library <a href="{{url_base}}{{ repo_url }}">{{ repo_name }}</a> has been deleted recently.{% endblocktrans %}</p>

                {% elif notice.is_saml_sso_error_msg %}
                <p style="line-height:1.5; margin:.2em 10px .2em 0;">{{notice.error_msg}}</p>

                {% elif notice.is_repo_monitor_msg %}
                <p style="line-height:1.5; margin:.2em 10px .2em 0;">{{notice.repo_monitor_msg|safe}}</p>
                {% endif %}
            </td>
            <td style="padding: 5px 3px; border-bottom: 1px solid #eee; font-size: 13px; color: #333; word-wrap: break-word;">{{ notice.timestamp|date:"Y-m-d G:i:s"}}</td>
        </tr>
        {% endfor %}
    </table>

<p style="font-size:14px;color:#434144;">
    {% trans "Go check out at the following page:" %}<br />
    <a href="{{ url_base }}?notifications=all">{{ url_base }}?notifications=all</a>
</p>
{% endblock %}
